package com.streambolics.worseminton.servlet;

import javax.servlet.http.HttpServletRequest;

import com.streambolics.worseminton.data.Invitation;

public class InvitationAcceptHandler extends InvitationHandler
{

    /**
     * 
     */
    private static final long serialVersionUID = 1L;

    @Override
    protected Invitation generateResponseObject (HttpServletRequest aRequest) throws Exception
    {
        Invitation i = super.generateResponseObject (aRequest);
        if (requireWritePermission (i))
        {
            i.setAccepted (true);
        }
        return i;
    }

    @Override
    protected String getRedirect (Invitation aResponseObject)
    {
        return aResponseObject.getIdUrl ("/go/Invitation");
    }

}
